package com.aaa.controller;

import com.aaa.entity.Ordermaster;
import com.aaa.service.impl.OrdermasterServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@Controller
@RequestMapping("om")
public class OrdermasterController {
    @Resource
    OrdermasterServiceImpl ordermasterService;
    @RequestMapping("list")
    @ResponseBody
    public List<Ordermaster> list(){
        return ordermasterService.list();
    }
    @RequestMapping("save")
    @ResponseBody
    public Boolean save(Ordermaster ordermaster){
        return ordermasterService.save(ordermaster);
    }
    @RequestMapping("remove")
    @ResponseBody
    public Boolean remove(Integer oid){
        return ordermasterService.removeById(oid);
    }
    @RequestMapping("update")
    @ResponseBody
    public Boolean update(Ordermaster ordermaster){
        return ordermasterService.updateById(ordermaster);
    }
}
